package file;

import java.io.File;
import java.io.FileFilter;

public class listFileDemo3 {
    public static void main(String[] args) {
        File dir=new File(".");
        if (dir.isDirectory()){
            File[]subs=dir.listFiles(pathname-> pathname.getName().endsWith(".txt") );
            for (File sub:subs){
                System.out.println(sub.getName());
            }

            };

        }
    }

